package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * Order entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_ORDER", schema = "MXZ")
public class Order extends Entity implements java.io.Serializable {

	// Fields

	private Long orderId;
	private Member memberByMemberId;
	private Member memberByCheckerId;
	private Store store;
	private String orderCode;
	private Long addressId;
	private String consignee;
	private String phone;
	private String address;
	private String postalCode;
	private Long payId;
	private String pay;
	private Long deliveryId;
	private String delivery;
	private String payMethod;
	private String remark;
	private Integer integral;
	private Float reckonCost;
	private Integer status;
	private Boolean isMemberDel;
	private Boolean isStoreDel;
	private Long orderTime;
	private Integer promoteType;
	private Long promoteId;
	private String promoteName;
	private Float promoteBack;
	private Float realCost;
	private Long statusTime;
	private Integer prevStatus;
	private Boolean isStockBack;
	private Integer payMethodType;
	private String serialCode;
	private Boolean isLocalSale;
	private Set<OrderGoods> orderGoodses = new HashSet<OrderGoods>(0);

	// Constructors

	/** default constructor */
	public Order() {
	}

	/** minimal constructor */
	public Order(Store store, String orderCode, String consignee, String phone,
			String address, String pay, String delivery, Integer integral,
			Float reckonCost, Integer status, Boolean isMemberDel,
			Boolean isStoreDel, Long orderTime, Float realCost,
			Long statusTime, Boolean isStockBack, Integer payMethodType,
			Boolean isLocalSale) {
		this.store = store;
		this.orderCode = orderCode;
		this.consignee = consignee;
		this.phone = phone;
		this.address = address;
		this.pay = pay;
		this.delivery = delivery;
		this.integral = integral;
		this.reckonCost = reckonCost;
		this.status = status;
		this.isMemberDel = isMemberDel;
		this.isStoreDel = isStoreDel;
		this.orderTime = orderTime;
		this.realCost = realCost;
		this.statusTime = statusTime;
		this.isStockBack = isStockBack;
		this.payMethodType = payMethodType;
		this.isLocalSale = isLocalSale;
	}

	/** full constructor */
	public Order(Member memberByMemberId, Member memberByCheckerId,
			Store store, String orderCode, Long addressId, String consignee,
			String phone, String address, String postalCode, Long payId,
			String pay, Long deliveryId, String delivery, String payMethod,
			String remark, Integer integral, Float reckonCost, Integer status,
			Boolean isMemberDel, Boolean isStoreDel, Long orderTime,
			Integer promoteType, Long promoteId, String promoteName,
			Float promoteBack, Float realCost, Long statusTime,
			Integer prevStatus, Boolean isStockBack, Integer payMethodType,
			String serialCode, Boolean isLocalSale, Set<OrderGoods> orderGoodses) {
		this.memberByMemberId = memberByMemberId;
		this.memberByCheckerId = memberByCheckerId;
		this.store = store;
		this.orderCode = orderCode;
		this.addressId = addressId;
		this.consignee = consignee;
		this.phone = phone;
		this.address = address;
		this.postalCode = postalCode;
		this.payId = payId;
		this.pay = pay;
		this.deliveryId = deliveryId;
		this.delivery = delivery;
		this.payMethod = payMethod;
		this.remark = remark;
		this.integral = integral;
		this.reckonCost = reckonCost;
		this.status = status;
		this.isMemberDel = isMemberDel;
		this.isStoreDel = isStoreDel;
		this.orderTime = orderTime;
		this.promoteType = promoteType;
		this.promoteId = promoteId;
		this.promoteName = promoteName;
		this.promoteBack = promoteBack;
		this.realCost = realCost;
		this.statusTime = statusTime;
		this.prevStatus = prevStatus;
		this.isStockBack = isStockBack;
		this.payMethodType = payMethodType;
		this.serialCode = serialCode;
		this.isLocalSale = isLocalSale;
		this.orderGoodses = orderGoodses;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_ORDER")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "ORDER_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getOrderId() {
		return this.orderId;
	}

	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MEMBER_ID")
	public Member getMemberByMemberId() {
		return this.memberByMemberId;
	}

	public void setMemberByMemberId(Member memberByMemberId) {
		this.memberByMemberId = memberByMemberId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CHECKER_ID")
	public Member getMemberByCheckerId() {
		return this.memberByCheckerId;
	}

	public void setMemberByCheckerId(Member memberByCheckerId) {
		this.memberByCheckerId = memberByCheckerId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STORE_ID", nullable = false)
	public Store getStore() {
		return this.store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	@Column(name = "ORDER_CODE", nullable = false, length = 50)
	public String getOrderCode() {
		return this.orderCode;
	}

	public void setOrderCode(String orderCode) {
		this.orderCode = orderCode;
	}

	@Column(name = "ADDRESS_ID", precision = 15, scale = 0)
	public Long getAddressId() {
		return this.addressId;
	}

	public void setAddressId(Long addressId) {
		this.addressId = addressId;
	}

	@Column(name = "CONSIGNEE", nullable = false, length = 60)
	public String getConsignee() {
		return this.consignee;
	}

	public void setConsignee(String consignee) {
		this.consignee = consignee;
	}

	@Column(name = "PHONE", nullable = false, length = 20)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "ADDRESS", nullable = false, length = 250)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "POSTAL_CODE", length = 20)
	public String getPostalCode() {
		return this.postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	@Column(name = "PAY_ID", precision = 15, scale = 0)
	public Long getPayId() {
		return this.payId;
	}

	public void setPayId(Long payId) {
		this.payId = payId;
	}

	@Column(name = "PAY", nullable = false, length = 100)
	public String getPay() {
		return this.pay;
	}

	public void setPay(String pay) {
		this.pay = pay;
	}

	@Column(name = "DELIVERY_ID", precision = 15, scale = 0)
	public Long getDeliveryId() {
		return this.deliveryId;
	}

	public void setDeliveryId(Long deliveryId) {
		this.deliveryId = deliveryId;
	}

	@Column(name = "DELIVERY", nullable = false, length = 100)
	public String getDelivery() {
		return this.delivery;
	}

	public void setDelivery(String delivery) {
		this.delivery = delivery;
	}

	@Column(name = "PAY_METHOD", length = 100)
	public String getPayMethod() {
		return this.payMethod;
	}

	public void setPayMethod(String payMethod) {
		this.payMethod = payMethod;
	}

	@Column(name = "REMARK", length = 400)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "INTEGRAL", nullable = false, precision = 8, scale = 0)
	public Integer getIntegral() {
		return this.integral;
	}

	public void setIntegral(Integer integral) {
		this.integral = integral;
	}

	@Column(name = "RECKON_COST", nullable = false, precision = 8)
	public Float getReckonCost() {
		return this.reckonCost;
	}

	public void setReckonCost(Float reckonCost) {
		this.reckonCost = reckonCost;
	}

	@Column(name = "STATUS", nullable = false, precision = 2, scale = 0)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "IS_MEMBER_DEL", nullable = false, precision = 1, scale = 0)
	public Boolean getIsMemberDel() {
		return this.isMemberDel;
	}

	public void setIsMemberDel(Boolean isMemberDel) {
		this.isMemberDel = isMemberDel;
	}

	@Column(name = "IS_STORE_DEL", nullable = false, precision = 1, scale = 0)
	public Boolean getIsStoreDel() {
		return this.isStoreDel;
	}

	public void setIsStoreDel(Boolean isStoreDel) {
		this.isStoreDel = isStoreDel;
	}

	@Column(name = "ORDER_TIME", nullable = false, precision = 15, scale = 0)
	public Long getOrderTime() {
		return this.orderTime;
	}

	public void setOrderTime(Long orderTime) {
		this.orderTime = orderTime;
	}

	@Column(name = "PROMOTE_TYPE", precision = 2, scale = 0)
	public Integer getPromoteType() {
		return this.promoteType;
	}

	public void setPromoteType(Integer promoteType) {
		this.promoteType = promoteType;
	}

	@Column(name = "PROMOTE_ID", precision = 15, scale = 0)
	public Long getPromoteId() {
		return this.promoteId;
	}

	public void setPromoteId(Long promoteId) {
		this.promoteId = promoteId;
	}

	@Column(name = "PROMOTE_NAME", length = 250)
	public String getPromoteName() {
		return this.promoteName;
	}

	public void setPromoteName(String promoteName) {
		this.promoteName = promoteName;
	}

	@Column(name = "PROMOTE_BACK", precision = 8)
	public Float getPromoteBack() {
		return this.promoteBack;
	}

	public void setPromoteBack(Float promoteBack) {
		this.promoteBack = promoteBack;
	}

	@Column(name = "REAL_COST", nullable = false, precision = 8)
	public Float getRealCost() {
		return this.realCost;
	}

	public void setRealCost(Float realCost) {
		this.realCost = realCost;
	}

	@Column(name = "STATUS_TIME", nullable = false, precision = 15, scale = 0)
	public Long getStatusTime() {
		return this.statusTime;
	}

	public void setStatusTime(Long statusTime) {
		this.statusTime = statusTime;
	}

	@Column(name = "PREV_STATUS", precision = 2, scale = 0)
	public Integer getPrevStatus() {
		return this.prevStatus;
	}

	public void setPrevStatus(Integer prevStatus) {
		this.prevStatus = prevStatus;
	}

	@Column(name = "IS_STOCK_BACK", nullable = false, precision = 1, scale = 0)
	public Boolean getIsStockBack() {
		return this.isStockBack;
	}

	public void setIsStockBack(Boolean isStockBack) {
		this.isStockBack = isStockBack;
	}

	@Column(name = "PAY_METHOD_TYPE", nullable = false, precision = 2, scale = 0)
	public Integer getPayMethodType() {
		return this.payMethodType;
	}

	public void setPayMethodType(Integer payMethodType) {
		this.payMethodType = payMethodType;
	}

	@Column(name = "SERIAL_CODE", length = 50)
	public String getSerialCode() {
		return this.serialCode;
	}

	public void setSerialCode(String serialCode) {
		this.serialCode = serialCode;
	}

	@Column(name = "IS_LOCAL_SALE", nullable = false, precision = 1, scale = 0)
	public Boolean getIsLocalSale() {
		return this.isLocalSale;
	}

	public void setIsLocalSale(Boolean isLocalSale) {
		this.isLocalSale = isLocalSale;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "order")
	public Set<OrderGoods> getOrderGoodses() {
		return this.orderGoodses;
	}

	public void setOrderGoodses(Set<OrderGoods> orderGoodses) {
		this.orderGoodses = orderGoodses;
	}

}